package com.sxj.corejava.code15_反射;

import java.io.Serializable;

/**
 * @author 石小俊
 */
public class User extends Person implements Serializable {
    private Integer id;
    protected String username;
    public String password;

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    private void show(){
        System.out.println("这是当前类中private修饰的方法");
    }

    protected void print(){
        System.out.println("这是当前类中protected修饰的方法");
    }

    public int add(int i, int j){
        return i + j;
    }

    public User() {
    }

    private User(Integer id) {
        this.id = id;
    }

    protected User(Integer id, String username) {
        this.id = id;
        this.username = username;
    }

    public User(Integer id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
